home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / ste / 50play.lzh / CIA_EMU.C < prev    next >
C/C++ Source or Header  |  1985-11-20  |  602b  |  23 lines

  1. /* Amiga Tempo -> STE DMA Frame Count(sample bvffer length)     */
  2. /* Dodgy 'C' code By Griff.. (Compile with GCC 2.0 or above...) */
  3.  
  4. #include <stdio.h>
  5. #define FILENAME "CIA_EMU.TAB"
  6.  
  7. void main()
  8. {    FILE *out;
  9.     void *x;
  10.     double tempo,hz,cia_clock=709378.92,temponum=1773447.0;
  11.     unsigned int i=0;
  12.     out = fopen(FILENAME,"wb");
  13.     x = (&i);
  14.     fwrite(x,2,1,out);            /* tempo=0 case */
  15.     for (tempo = 1 ; tempo <= 255 ; tempo++) 
  16.     {    hz = (cia_clock/temponum)*tempo;
  17.         i = (25033.0/hz);                /* FRAME COUNT     */
  18.         i = i << 16;
  19.         fwrite(x,2,1,out);        /* OUTPUT IT!   */
  20.     }
  21.     fclose(out);
  22. }
  23.